x86/mm: refine epte_present test
authorTim Deegan <tim@xen.org>
Thu, 19 Jan 2012 13:09:23 +0000 (13:09 +0000)
committerTim Deegan <tim@xen.org>
Thu, 19 Jan 2012 13:09:23 +0000 (13:09 +0000)
commit2d94bc491a586d28d00575b52ea60cc08c71f7b6
treed60ac8698f72c6d905a204e3671586f10ecaf698
parentcd00a203a562caad39fa774e414a02fbdd99333c
x86/mm: refine epte_present test

The current test for a present ept entry checks for a permission bit
to be set.

While this is valid in contexts in which we want to know whether an entry
will fault, it is not correct when it comes to testing whether an entry is
valid. Specifically, in the ept_change_entry_type_page function which is
used to set entries to the log dirty type.

In combination with a p2m access type like n or n2rwx, log dirty will not be
set for ept entries for which it should.

Reported-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m-ept.c